// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  vdh_crg_c_union_define.h
// Project line  :  K3
// Department    :  K3
// Author        :  Huawei
// Version       :  V100
// Date          :  2015/4/10
// Description   :  HiVcodecV100 VDEC
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/04/10 10:02:39 Create file
// ******************************************************************************

#ifndef __VDH_CRG_C_UNION_DEFINE_H__
#define __VDH_CRG_C_UNION_DEFINE_H__

/* Define the union U_VDH_CLKSEL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0          : 24  ; /* [31:8] */
        unsigned int    vdh_bpd_clken  : 2  ; /* [7:6] */
        unsigned int    vdh_scd_clken  : 2  ; /* [5:4] */
        unsigned int    vdh_mfde_clken : 2  ; /* [3:2] */
        unsigned int    vdh_vdec_clken : 2  ; /* [1:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_CLKSEL;

/* Define the union U_VDH_SRST_REQ */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_1             : 28  ; /* [31:4] */
        unsigned int    vdh_bpd_srst_req  : 1  ; /* [3] */
        unsigned int    vdh_scd_srst_req  : 1  ; /* [2] */
        unsigned int    vdh_mfde_srst_req : 1  ; /* [1] */
        unsigned int    vdh_all_srst_req  : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_SRST_REQ;

/* Define the union U_VDH_SRST_ST */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_2            : 24  ; /* [31:8] */
        unsigned int    vdh_mfde_idle    : 1  ; /* [7] */
        unsigned int    vdh_scd_idle     : 1  ; /* [6] */
        unsigned int    vdh_bpd_idle     : 1  ; /* [5] */
        unsigned int    vdh_idle         : 1  ; /* [4] */
        unsigned int    vdh_bpd_srst_ok  : 1  ; /* [3] */
        unsigned int    vdh_scd_srst_ok  : 1  ; /* [2] */
        unsigned int    vdh_mfde_srst_ok : 1  ; /* [1] */
        unsigned int    vdh_all_srst_ok  : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_SRST_ST;

/* Define the union U_VDH_RAS_CTRL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_3             : 31  ; /* [31:1] */
        unsigned int    vdh_ras_ctrl_flag : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_RAS_CTRL;

/* Define the union U_VDH_RAS_INT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_4            : 31  ; /* [31:1] */
        unsigned int    vdec_ras_err_int : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_RAS_INT;

/* Define the union U_VDH_MEM_ERR_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_5               : 28  ; /* [31:4] */
        unsigned int    cmp_ecc_multi_err   : 1  ; /* [3] */
        unsigned int    cmp_ecc_err         : 1  ; /* [2] */
        unsigned int    vctrl_ecc_multi_err : 1  ; /* [1] */
        unsigned int    vctrl_ecc_err       : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_MEM_ERR_STATE;

/* Define the union U_VDH_RAS_INT_MASK */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_6             : 31  ; /* [31:1] */
        unsigned int    vdec_ras_int_mask : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_RAS_INT_MASK;

/* Define the union U_VDH_RAS_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_7                  : 31  ; /* [31:1] */
        unsigned int    vdec_ras_err_int_state : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_VDH_RAS_STATE;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_VDH_CLKSEL        VDH_CLKSEL        ; /* 4 */
    volatile U_VDH_SRST_REQ      VDH_SRST_REQ      ; /* C */
    volatile U_VDH_SRST_ST       VDH_SRST_ST       ; /* 10 */
    volatile U_VDH_RAS_CTRL      VDH_RAS_CTRL      ; /* 14 */
    volatile U_VDH_RAS_INT       VDH_RAS_INT       ; /* 18 */
    volatile U_VDH_MEM_ERR_STATE VDH_MEM_ERR_STATE ; /* 1C */
    volatile U_VDH_RAS_INT_MASK  VDH_RAS_INT_MASK  ; /* 20 */
    volatile U_VDH_RAS_STATE     VDH_RAS_STATE     ; /* 24 */

} S_vdh_crg_REGS_TYPE;

/* Declare the struct pointor of the module vdh_crg */
extern volatile S_vdh_crg_REGS_TYPE *gopvdh_crgAllReg;

/* Declare the functions that set the member value */
int iSetVDH_CLKSEL_vdh_bpd_clken(unsigned int uvdh_bpd_clken);
int iSetVDH_CLKSEL_vdh_scd_clken(unsigned int uvdh_scd_clken);
int iSetVDH_CLKSEL_vdh_mfde_clken(unsigned int uvdh_mfde_clken);
int iSetVDH_CLKSEL_vdh_vdec_clken(unsigned int uvdh_vdec_clken);
int iSetVDH_SRST_REQ_vdh_bpd_srst_req(unsigned int uvdh_bpd_srst_req);
int iSetVDH_SRST_REQ_vdh_scd_srst_req(unsigned int uvdh_scd_srst_req);
int iSetVDH_SRST_REQ_vdh_mfde_srst_req(unsigned int uvdh_mfde_srst_req);
int iSetVDH_SRST_REQ_vdh_all_srst_req(unsigned int uvdh_all_srst_req);
int iSetVDH_SRST_ST_vdh_mfde_idle(unsigned int uvdh_mfde_idle);
int iSetVDH_SRST_ST_vdh_scd_idle(unsigned int uvdh_scd_idle);
int iSetVDH_SRST_ST_vdh_bpd_idle(unsigned int uvdh_bpd_idle);
int iSetVDH_SRST_ST_vdh_idle(unsigned int uvdh_idle);
int iSetVDH_SRST_ST_vdh_bpd_srst_ok(unsigned int uvdh_bpd_srst_ok);
int iSetVDH_SRST_ST_vdh_scd_srst_ok(unsigned int uvdh_scd_srst_ok);
int iSetVDH_SRST_ST_vdh_mfde_srst_ok(unsigned int uvdh_mfde_srst_ok);
int iSetVDH_SRST_ST_vdh_all_srst_ok(unsigned int uvdh_all_srst_ok);
int iSetVDH_RAS_CTRL_vdh_ras_ctrl_flag(unsigned int uvdh_ras_ctrl_flag);
int iSetVDH_RAS_INT_vdec_ras_err_int(unsigned int uvdec_ras_err_int);
int iSetVDH_MEM_ERR_STATE_cmp_ecc_multi_err(unsigned int ucmp_ecc_multi_err);
int iSetVDH_MEM_ERR_STATE_cmp_ecc_err(unsigned int ucmp_ecc_err);
int iSetVDH_MEM_ERR_STATE_vctrl_ecc_multi_err(unsigned int uvctrl_ecc_multi_err);
int iSetVDH_MEM_ERR_STATE_vctrl_ecc_err(unsigned int uvctrl_ecc_err);
int iSetVDH_RAS_INT_MASK_vdec_ras_int_mask(unsigned int uvdec_ras_int_mask);
int iSetVDH_RAS_STATE_vdec_ras_err_int_state(unsigned int uvdec_ras_err_int_state);

#endif // __VDH_CRG_C_UNION_DEFINE_H__
